# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=psutils
pkgver=1.17
pkgrel=5
pkgdesc="A set of postscript utilities"
url="http://knackered.org/angus/psutils"
arch="all"
license="custom"
depends="perl"
depends_dev="perl-dev"
makedepends="$depends_dev"
subpackages="$pkgname-dev $pkgname-doc"
source="https://sources.archlinux.org/other/psutils/psutils-$pkgver.tar.gz
	psutils-1.17.patch"

builddir="$srcdir"/$pkgname
prepare() {
	default_prepare
}

build() {
	make -f Makefile.unix BINDIR=/usr/bin \
	    INCLUDEDIR=/usr/include/psutils PERL=/usr/bin/perl \
	    MANDIR=/usr/share/man/man1 \
	    CFLAGS="$CFLAGS -DPAPER=\\\"letter\\\" -DUNIX -Wall" \
	    CCFLAGS="$LDFLAGS"
}

package() {
	install -d -m755 "$pkgdir/usr/include"
	install -d -m755 "$pkgdir/usr/share/man"
	make -f Makefile.unix BINDIR="$pkgdir/usr/bin" \
	    INCLUDEDIR="$pkgdir/usr/include/psutils" PERL=/usr/bin/perl \
	    MANDIR="$pkgdir/usr/share/man/man1" install
	install -m755 -d "$pkgdir/usr/share/licenses/$pkgname"
	install -m644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/"
}

sha512sums="91feff88c885173ab1c4ba6b5ffd0d9e90bfa6105479b074065584fc2a87e78fbe71e4bc90d2e7079d86b467caf092b6744b0ea4234880ba78cad8dd7820de77  psutils-1.17.tar.gz
795f45c6315e3c02485d1d5243c1541992b669539257249a185f57136e623c489a9f3635d3f171f698428aeb9710332cf36bb0aa0ade8ea351514044630f12f0  psutils-1.17.patch"
